<template>
  <div id="building">
    <div class="revise">
      <div class="pass">
        <div class="icon"><i class="el-icon-lock" size="20px"></i></div>
        <input
          class="txt"
          type="password"
          placeholder="请输入密码"
          v-model="password"
        />
      </div>
      <div class="repass">
        <div class="icon"><i class="el-icon-lock" size="20px"></i></div>
        <input
          class="txt"
          type="password"
          placeholder="请输入新密码"
          v-model="newpassword"
        />
      </div>
      <div class="repass">
        <div class="icon"><i class="el-icon-lock" size="20px"></i></div>
        <input
          class="txt"
          type="password"
          placeholder="请重新输入新密码"
          v-model="renewpassword"
        />
      </div>
      <button @click="login()">修改</button>
    </div>
  </div>
</template>

<script>
import Cookie from "js-cookie";
import { GetReviseApi } from "../request/api";
export default {
  data() {
    return {
      password: "",
      newpassword: "",
      renewpassword: "",
    };
  },
  created() {},
  mounted() {},
  methods: {
    login() {
      let userId = Cookie.get("id");
      console.log(userId);
      GetReviseApi({
        id: userId,
        password: this.password,
        newPass: this.newpassword,
        rePass: this.renewpassword,
      }).then((res) => {
        console.log(res);
      });
    },
  },
};
</script>

<style scoped lang="less">
#building{
  background: url("../assets/R-C.jpg");
  background-repeat: no-repeat;
  background-size: 100% 100%;
  position: fixed;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  .revise {
  width: 400px;
  height: 400px;
  border: 1px solid #000;
  margin-left: 1000px;
  margin-top: 100px;
  padding: 0 20px;
  box-sizing: border-box;
  .user {
    display: flex;
    align-items: center;
    margin-top: 50px;
    .icon {
      height: 50px;
      width: 50px;
      background-color: #008ecb;
      i {
        color: #fff;
        font-weight: 700;
        font-size: 30px;
        line-height: 50px;
        margin-left: 6px;
      }
    }
  }
  .pass,
  .repass {
    display: flex;
    align-items: center;
    margin-top: 30px;
    .icon {
      height: 50px;
      width: 50px;
      background-color: #008ecb;
      i {
        color: #fff;
        font-weight: 700;
        font-size: 30px;
        line-height: 50px;
        margin-left: 6px;
      }
    }
  }
  button {
    margin-top: 60px;
    width: 100%;
    height: 50px;
    background-color: #008ecb;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 20px;
  }
  .txt {
    width: 100%;
    height: 50px;
    padding-left: 10px;
    box-sizing: border-box;
  }
}
}

</style>
